\(\int \frac {\cos (x)}{a-a \sin ^2(x)} \, dx\) [265]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 7 \[ \int \frac {\cos (x)}{a-a \sin ^2(x)} \, dx=\frac {\text {arctanh}(\sin (x))}{a} \]

[Out]

arctanh(sin(x))/a

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3254, 3855} \[ \int \frac {\cos (x)}{a-a \sin ^2(x)} \, dx=\frac {\text {arctanh}(\sin (x))}{a} \]

[In]

Int[Cos[x]/(a - a*Sin[x]^2),x]

[Out]

ArcTanh[Sin[x]]/a

Rule 3254

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Dist[a^p, Int[ActivateTrig[u*cos[e + f*x
]^(2*p)], x], x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0] && IntegerQ[p]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \sec (x) \, dx}{a} \\ & = \frac {\text {arctanh}(\sin (x))}{a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (x)}{a-a \sin ^2(x)} \, dx=\frac {\text {arctanh}(\sin (x))}{a} \]

[In]

Integrate[Cos[x]/(a - a*Sin[x]^2),x]

[Out]

ArcTanh[Sin[x]]/a

Maple [A] (verified)

Time = 0.28 (sec) , antiderivative size = 8, normalized size of antiderivative = 1.14

method result size
derivativedivides \(\frac {\operatorname {arctanh}\left (\sin \left (x \right )\right )}{a}\) \(8\)
default \(\frac {\operatorname {arctanh}\left (\sin \left (x \right )\right )}{a}\) \(8\)
parallelrisch \(\frac {-\ln \left (\tan \left (\frac {x}{2}\right )-1\right )+\ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{a}\) \(22\)
norman \(\frac {\ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{a}-\frac {\ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{a}\) \(25\)
risch \(\frac {\ln \left ({\mathrm e}^{i x}+i\right )}{a}-\frac {\ln \left ({\mathrm e}^{i x}-i\right )}{a}\) \(29\)

[In]

int(cos(x)/(a-a*sin(x)^2),x,method=_RETURNVERBOSE)

[Out]

arctanh(sin(x))/a

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 20 vs. \(2 (7) = 14\).

Time = 0.28 (sec) , antiderivative size = 20, normalized size of antiderivative = 2.86 \[ \int \frac {\cos (x)}{a-a \sin ^2(x)} \, dx=\frac {\log \left (\sin \left (x\right ) + 1\right ) - \log \left (-\sin \left (x\right ) + 1\right )}{2 \, a} \]

[In]

integrate(cos(x)/(a-a*sin(x)^2),x, algorithm="fricas")

[Out]

1/2*(log(sin(x) + 1) - log(-sin(x) + 1))/a

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 19 vs. \(2 (5) = 10\).

Time = 0.11 (sec) , antiderivative size = 19, normalized size of antiderivative = 2.71 \[ \int \frac {\cos (x)}{a-a \sin ^2(x)} \, dx=- \frac {\log {\left (\sin {\left (x \right )} - 1 \right )}}{2 a} + \frac {\log {\left (\sin {\left (x \right )} + 1 \right )}}{2 a} \]

[In]

integrate(cos(x)/(a-a*sin(x)**2),x)

[Out]

-log(sin(x) - 1)/(2*a) + log(sin(x) + 1)/(2*a)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 21 vs. \(2 (7) = 14\).

Time = 0.24 (sec) , antiderivative size = 21, normalized size of antiderivative = 3.00 \[ \int \frac {\cos (x)}{a-a \sin ^2(x)} \, dx=\frac {\log \left (\sin \left (x\right ) + 1\right )}{2 \, a} - \frac {\log \left (\sin \left (x\right ) - 1\right )}{2 \, a} \]

[In]

integrate(cos(x)/(a-a*sin(x)^2),x, algorithm="maxima")

[Out]

1/2*log(sin(x) + 1)/a - 1/2*log(sin(x) - 1)/a

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 23 vs. \(2 (7) = 14\).

Time = 0.31 (sec) , antiderivative size = 23, normalized size of antiderivative = 3.29 \[ \int \frac {\cos (x)}{a-a \sin ^2(x)} \, dx=\frac {\log \left (\sin \left (x\right ) + 1\right )}{2 \, a} - \frac {\log \left (-\sin \left (x\right ) + 1\right )}{2 \, a} \]

[In]

integrate(cos(x)/(a-a*sin(x)^2),x, algorithm="giac")

[Out]

1/2*log(sin(x) + 1)/a - 1/2*log(-sin(x) + 1)/a

Mupad [B] (verification not implemented)

Time = 13.74 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (x)}{a-a \sin ^2(x)} \, dx=\frac {\mathrm {atanh}\left (\sin \left (x\right )\right )}{a} \]

[In]

int(cos(x)/(a - a*sin(x)^2),x)

[Out]

atanh(sin(x))/a